package com.lz.gmall.web.controller;

import com.lz.gamll.feign.order.OrderFeignClient;
import com.lz.gmall.order.entity.OrderInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author 郭运龙
 */
@Controller
public class PayController {

    @Autowired
    private OrderFeignClient orderFeignClient;

    @GetMapping("/pay.html")
    public String payment(String orderId, Model model){
        OrderInfo orderInfo = orderFeignClient.getPayOrder(orderId).getData();
        model.addAttribute("orderInfo",orderInfo);
        return "payment/pay";
    }

    @GetMapping(value = "/payment/success.html")
    public String paySuccess() {
        return "payment/success" ;
    }
}
